package com.uchedao.seller.ui.car.publish;

import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;

import com.uchedao.seller.R;
import com.uchedao.seller.inf.IOnResultBack;
import com.uchedao.seller.manager.ActivityManager;
import com.uchedao.seller.ui.car.base.BasePublishActivity;
import com.uchedao.seller.ui.car.publish.condition.ConditionVFunctioniew;
import com.uchedao.seller.util.T;

/**
 * 发布1-车型参数
 */
public class PublishVehicleActivity extends BasePublishActivity {

    private RelativeLayout rlContent;
    private ConditionVFunctioniew contentView;

    @Override
    protected String getActivityTag() {
        return "PublishVehicleActivity";
    }

    @Override
    protected int getLayoutResID() {
        return R.layout.activity_publish_vehicle;
    }

    @Override
    protected void initView() {
        initToBar("车型参数");
        initBottomBar();
        btnBottomNext.setText("下一步:基本信息");
        rlContent = (RelativeLayout) findViewById(R.id.rlPublishContent);
        contentView = new ConditionVFunctioniew(this);
        rlContent.addView(contentView);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {
        btnButtomSave.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ActivityManager.getInstance().clearAllActivity(null);
            }
        });
        btnBottomNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(contentView.save())
                    startActivity(new Intent(PublishVehicleActivity.this, PublishBaseInfoActivity.class));
                else
                    T.showShort(PublishVehicleActivity.this, "请完善信息");
            }
        });
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        ((IOnResultBack) contentView).onActivityResultView(requestCode, resultCode, data);
    }
}
